package com.neuedu.nep.controller;

import com.neuedu.nep.base.R;
import com.neuedu.nep.model.Aqi;
import com.neuedu.nep.service.AqiService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author 黄宇佳
 * @create 2024-04-10 15:33
 * @description:
 */
@RestController
@CrossOrigin
@RequestMapping("aqi")
public class AqiController {
    @Resource
    private AqiService aqiService;

    @GetMapping("aqiAll")
    public R aqiAll(){
        List<Aqi> aqis = aqiService.AqiAll();
        return R.ok().setResult("aqis",aqis);
    }

    @GetMapping("testAqi")
    public R testAqi(@RequestParam Integer type,@RequestParam int input){
        Aqi aqi = aqiService.testAqi(type, input);
        return R.ok().setResult("aqi",aqi);
    }
}
